package com.grand.security.springmvc.init;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

import com.grand.security.springmvc.config.ApplicationConfig;
import com.grand.security.springmvc.config.WebConfig;

/**
 * SpringApplicationInitializer相当于web.xml
 * ，使用了servlet3.0开发则不需要再定义web.xml
 */
public class SpringApplicationInitializer extends 
AbstractAnnotationConfigDispatcherServletInitializer{

	@Override
	protected Class<?>[] getRootConfigClasses() {
		return new Class<?>[] { ApplicationConfig.class };//指定rootContext的配置类
	}

	@Override
	protected Class<?>[] getServletConfigClasses() {
		return new Class<?>[] { WebConfig.class }; //指定servletContext的配置类
	}

	@Override
	protected String[] getServletMappings() {
		return new String [] {"/"};
	}

}
